package common

import (
	"fmt"
	"github.com/jinzhu/gorm"
	_ "github.com/jinzhu/gorm/dialects/mysql"
)

var Db *gorm.DB

func MySqlConnInit()  {
	fmt.Println("main init")

	db, err := gorm.Open("mysql", "root:@tcp(localhost:3306)/reggie?charset=utf8&parseTime=True&loc=Local")

	if err != nil {
		panic(err)
		fmt.Println("err = ", err)
	}

	Db = db
}
